Ignore hide-titlebar-when-maximized for CSD
authorMatthias Clasen <mclasen@redhat.com>
Fri, 31 Jan 2014 13:45:23 +0000 (08:45 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 31 Jan 2014 13:45:23 +0000 (08:45 -0500)
This setting really only makes sense for wm titlebars,
client-side titlebars are under application control
anyway.

gtk/gtkwindow.c

index 85b03b0561a07130631c046fa3ca2df8ddfe4449..dd756deaf234a438983be2c86e233f686e65365d 100644 (file)
@@ -3440,13 +3440,18 @@ gtk_window_get_destroy_with_parent (GtkWindow *window)
  *
  * If @setting is %TRUE, then @window will request that it's titlebar
  * should be hidden when maximized.
+ *
  * This is useful for windows that don't convey any information other
  * than the application name in the titlebar, to put the available
  * screen space to better use. If the underlying window system does not
  * support the request, the setting will not have any effect.
  *
+ * Note that custom titlebars set with gtk_window_set_titlebar() are
+ * not affected by this. The application is in full control of their
+ * content and visibility anyway.
+ * 
  * Since: 3.4
- **/
+ */
 void
 gtk_window_set_hide_titlebar_when_maximized (GtkWindow *window,
                                              gboolean   setting)
@@ -5299,28 +5304,11 @@ get_default_title (void)
   return title;
 }
 
-static gboolean
-update_csd_visibility (GtkWindow *window)
-{
-  GtkWindowPrivate *priv = window->priv;
-  gboolean visible;
-
-  if (priv->title_box == NULL)
-    return FALSE;
-
-  visible = !priv->fullscreen && !(priv->maximized && priv->hide_titlebar_when_maximized);
-  gtk_widget_set_child_visible (priv->title_box, visible);
-  return visible;
-}
-
 static void
 update_window_buttons (GtkWindow *window)
 {
   GtkWindowPrivate *priv = window->priv;
 
-  if (!update_csd_visibility (window))
-    return;
-
   if (GTK_IS_HEADER_BAR (priv->title_box))
     _gtk_header_bar_update_window_buttons (GTK_HEADER_BAR (priv->title_box));
 }